package com.tjp.mall.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.tjp.common.exception.groups.AddGroupsInterface;
import com.tjp.common.exception.groups.UpdateGroupsInterface;
import lombok.Data;
import org.apache.ibatis.annotations.Update;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;

/**
 * Ʒ?
 * 
 * @author tjp
 * @email tjpcorner@126.com
 * @date 2022-07-20 12:35:45
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * Ʒ??id
	 */
	@NotNull(message = "更新品牌数据ID不能为空", groups = UpdateGroupsInterface.class)
	@Null(message = "添加品牌数据ID必须为空", groups = AddGroupsInterface.class)
	@TableId
	private Long brandId;
	/**
	 * Ʒ????
	 */
	@NotNull(groups = AddGroupsInterface.class)
	@NotBlank(message = "品牌信息不能为空", groups = {UpdateGroupsInterface.class, AddGroupsInterface.class})
	private String name;
	/**
	 * Ʒ??logo??ַ
	 */
	@NotBlank(message = "logo不能为空", groups = {UpdateGroupsInterface.class, AddGroupsInterface.class})
	@URL(message = "logo必须是一个合法的url", groups = {UpdateGroupsInterface.class, AddGroupsInterface.class})
	private String logo;
	/**
	 * ???
	 */
	private String descript;
	/**
	 * ??ʾ״̬[0-????ʾ??1-??ʾ]
	 */
//	@TableLogic(value = "1", delval = "0")
	private Integer showStatus;
	/**
	 * ????????ĸ
	 */
	@NotBlank(message = "检索首字母不能为空", groups = AddGroupsInterface.class)
	@Pattern(regexp = "^[A-Za-z]+$", message = "检索首字母必须是单个的字母", groups = {UpdateGroupsInterface.class, AddGroupsInterface.class})
	private String firstLetter;
	/**showStatus
	 * ???
	 */
	@NotNull(message = "排序字段不能为空", groups = AddGroupsInterface.class)
	@Min(value = 0, message = "排序不能小于0", groups = {UpdateGroupsInterface.class, AddGroupsInterface.class})
	private Integer sort;

}
